from matplotlib import pyplot as plt

data1 = (
    ('e', '8', 3.2953685),
    ('e', '16', 3.3040925),
    ('e', '32', 4.2961955),
    ('v', '8', 1.0624485),
    ('v', '16', 2.1204755),
    ('v', '32', 4.2417305),
)

data2 = (
    ('e', '8', 1.3359434),
    ('e', '16', 2.6552734),
    ('e', '32', 5.2392658),
    ('v', '8', 1.0598014),
    ('v', '16', 2.1229868),
    ('v', '32', 4.2343362),
)

fig = plt.figure()

t, s, y1 = zip(*data1)
t, s, y2 = zip(*data2)
plt.plot(range(1, 4), y1[:3], '-', color='r', linewidth=4, markersize=10)
plt.plot(range(1, 4), y2[:3], '--', color='m', linewidth=4)
plt.plot(range(1, 4), y1[3:], '-', color='b', linewidth=4, markersize=10)
plt.plot(range(1, 4), y2[3:], '--', color='c', linewidth=4)

plt.ylim(0, 8)
plt.xlabel('bits')
plt.ylabel('segons')
plt.xticks(range(1, 4), s[:3])
plt.legend(['scalar -O2', 'scalar -O3', 'vectorial -O2', 'vectorial -O3'])

plt.savefig('plot.png')
